'use strict';
/* jshint mocha: true */

var path = require('path');
var expect = require('chai').expect;
var Injector = require('injector');
var _ = require('lodash');

var projectPath = path.resolve(__dirname, '..');
var includePaths = [projectPath + '/lib', projectPath + '/example'];

describe('test/test_funcs', function () {
    it('#it should have 2 instance of mongodb client', function () {
        function test(mongodb) {
            // jshint -W030
            _.each([
                'resultN',
                'resultInsertedId',
                'mapDocId',
                'mapDocsId',
                'fillDefToDoc',
                'fillDefToDocs',
                'pickOneDoc',
                'fillIdToDoc',
                'fillIdToDocs',
                'makeFilterWithObjectId',
                'makeFilterWithObjectIds',
                'makeFilterWithoutObjectIds'
            ], function (fname) {
                expect(mongodb[fname]).to.be.a.function;
            });
            // jshint +W030
        }
        var injector = new Injector(includePaths, {});
        var moduleDefinition = Injector.define([
            'component/mongodb'
        ], test);
        injector.inject(moduleDefinition);
    });
});